<!-- Ndas -->
<div class="main-window-segment" style="padding-top: none; padding-bottom: 20px;">
    <div class="container-fluid">
        <div class="row">

            <div class="col-lg-10 col-md-6 col-sm-12">
                <h2>Rekap Deviasi RPD Harian Satker</h2>
            </div>
			<div class="col-lg-1 col-md-3 col-sm-12" style="padding-top: 20px;">
<?php
                //----------------------------------------------------
                //Development History.Revisi : 0 Kegiatan :1.mencetak hasil filter ke dalam pdf Dibuat oleh : Rifan Abdul Rachman Tanggal dibuat : 18-07-2014  File yang diubah : test.php  
                
						if (isset($this->d_bulan)) {
							$kdbulan = $this->d_bulan;
						} else {
							$kdbulan = 'SEMUA';
						}
						if (isset($this->d_minggu)) {
							$kdminggu = $this->d_minggu;
						} else {
							$kdminggu = 'SEMUA';
						}
						if (isset($this->d_akun)) {
							$kdakun = $this->d_akun;
						} else {
							$kdakun = 'SEMUA';
						}
						if (Session::get('role') == ADMIN || Session::get('role') == PKN || Session::get('role') == KPPN) {
							if (isset($this->d_kanwil)) {
								$kdkanwil = $this->d_kanwil;
							}else{
								$kdkanwil = 'SEMUA';
							}
							if (isset($this->d_kd_kppn)) {
								$kdkppn = $this->d_kd_kppn;
							}else{
								$kdkppn = 'SEMUA';
							}
							if (isset($this->d_kdsatker)) {
								$kdsatker = $this->d_kdsatker;
							}else{
								$kdsatker = 'SEMUA';
							}							
						}
						if (Session::get('role') == SATKER) {
							if (isset($this->d_kdsatker)) {
								$kdsatker = $this->d_kdsatker;
							}else{
								$kdsatker = Session::get('kd_satker');
							}
							if (isset($this->d_kanwil)) {
								$kdkanwil = $this->d_kanwil;
							}else{
								$kdkanwil = 'SEMUA';
							}
							if (isset($this->d_kd_kppn)) {
								$kdkppn = $this->d_kd_kppn;
							}else{
								$kdkppn = 'SEMUA';
							}
						}


						?>
                <div class="btn-group-sm">
                    <button type="button" class="btn btn-default dropdown-toggle fullwidth" data-toggle="dropdown" aria-expanded="false"><span class="glyphicon glyphicon-print"></span>&nbsp; Cetak <span class="caret"></span>
                    </button>
                          <ul class="dropdown-menu" role="menu">
                            <li><a href="<?php echo URL; ?>PDF/rekapRPDSatker_PDF/<?php echo $kdbulan . "/" . $kdkanwil . "/" . $kdkppn . "/" . $kdsatker; ?>/PDF">PDF</a></li>
                            <li><a href="<?php echo URL; ?>PDF/rekapRPDSatker_PDF/<?php echo $kdbulan . "/" . $kdkanwil . "/" . $kdkppn . "/" . $kdsatker; ?>/XLS">EXCEL</a></li>
                          </ul>
                </div>
						
						<?php
						//----------------------------------------------------		
					
              ?>
            </div>
            <div class="col-lg-1 col-md-3 col-sm-12" style="padding-top: 20px;">

                <button type="button" style="width: 100%" class="btn btn-default" data-toggle="modal" data-target="#modal-app-filter"><span class="glyphicon glyphicon-filter"></span> Filter</button>

            </div>
            
        </div>
        
        

        <div class="row" style="padding-top: 10px">

            <div class="col-md-6 col-sm-12">
                <?php
                if (isset($this->d_bulan)) {
                    echo "Bulan : ".Tanggal::bulan_indo($this->d_bulan);
                }
                if (isset($this->d_minggu)) {
                    echo "<br/>Minggu : ".$this->d_minggu;
                }
                if (isset($this->d_kanwil)) {
                    foreach ($this->d_nama_kanwil as $kanwil) {
                        echo "<br/>Kanwil : ".$kanwil->get_nama_user() . " (" . substr($kanwil->get_kd_satker(),1,2) . ")";
                        $kode_kanwil = $kanwil->get_kd_satker();
                    }
                }
                if (isset($this->d_nama_kppn)) {
                    foreach ($this->d_nama_kppn as $kppn) {
                        echo "<br/>".$kppn->get_nama_user() . " (" . $kppn->get_kd_satker() . ")";
                        $kode_kppn = $kppn->get_kd_satker();
                    }
                }
                if (isset($this->d_kdsatker)) {
                    echo "<br/>Satker : ".$this->d_kdsatker;
                }
                if (isset($this->d_akun)) {
                    echo "<br/>Akun : ".$this->d_akun;
                }
                ?>
            </div>

            <div class="col-md-6 col-sm-12" style="text-align: right;">
                <?php
                echo "<i>(Data dalam jutaan Rupiah)</i><br>";
                // untuk menampilkan last_update
                if (isset($this->last_update)) {
                    foreach ($this->last_update as $last_update) {
                        echo "Update Data Terakhir (Waktu Server)<br/>" . $last_update->get_last_update() . " WIB";
                    }
                }
                
                ?>
            </div>

        </div>

    </div>
</div>
<?php 
if ($this->d_minggu==1){$tambah_hari = 0;}
elseif ($this->d_minggu==2){$tambah_hari = 7;}
elseif ($this->d_minggu==3){$tambah_hari = 15;}
elseif ($this->d_minggu==4){$tambah_hari = 23;}
?>
<!-- Tabel -->
<div id="table-container" class="wrapper">
    <table class="footable">
        <!--baris pertama-->
        <thead>
            <tr>
                <th rowspan = '2'>No.</th>
                <th rowspan = '2'>Kode</th>
                <th rowspan = '2'>Satker</th>
                <th>1</th>
                <th>2</th>
                <th>3</th>
                <th>4</th>
                <th>5</th>
                <th>6</th>
                <th>7</th>
                <th>8</th>
                <th>9</th>
                <th>10</th>
                <th>11</th>
                <th>12</th>
                <th>13</th>
                <th>14</th>
                <th>15</th>
                <th>16</th>
                <th>17</th>
                <th>18</th>
                <th>19</th>
                <th>20</th>
                <th>21</th>
                <th>22</th>
                <th>23</th>
                <th>24</th>
                <th>25</th>
                <th>26</th>
                <th>27</th>
                <th>28</th>
                <th>29</th>
                <th>30</th>
                <th>31</th>
            </tr>
            <tr>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
            </tr>
        </thead>
        <tbody class='align-right'>
            <?php
            $no = 1;
            $total_rpd1 ;
            $total_rpd2 ;
            $total_rpd3 ;
            $total_rpd4 ;
            $total_rpd5 ;
            $total_rpd6 ;
            $total_rpd7 ;
            $total_rpd8 ;
            $total_rpd9 ;
            $total_rpd10 ;
            $total_rpd11 ;
            $total_rpd12 ;
            $total_rpd13 ;
            $total_rpd14 ;
            $total_rpd15 ;
            $total_rpd16 ;
            $total_rpd17 ;
            $total_rpd18 ;
            $total_rpd19 ;
            $total_rpd20 ;
            $total_rpd21 ;
            $total_rpd22 ;
            $total_rpd23 ;
            $total_rpd24 ;
            $total_rpd25 ;
            $total_rpd26 ;
            $total_rpd27 ;
            $total_rpd28 ;
            $total_rpd29 ;
            $total_rpd30 ;
            $total_rpd31 ;
            if (isset($this->data)) {
                if (empty($this->data)) {
                    echo '<td colspan=12 align="center">Tidak ada data.</td>';
                } else {
                    foreach ($this->data as $value) {
                        if($value->get_rpd_1()>100){$rpd1=100;}elseif(is_null($value->get_rpd_1())){$rpd1=  '-';}else{$rpd1=$value->get_rpd_1();}
                        if($value->get_rpd_2()>100){$rpd2=100;}elseif(is_null($value->get_rpd_2())){$rpd2 = '-';}else{$rpd2=$value->get_rpd_2();}
                        if($value->get_rpd_3()>100){$rpd3=100;}elseif(is_null($value->get_rpd_3())){$rpd3 = '-';}else{$rpd3=$value->get_rpd_3();}
                        if($value->get_rpd_4()>100){$rpd4=100;}elseif(is_null($value->get_rpd_4())){$rpd4 = '-';}else{$rpd4=$value->get_rpd_4();}
                        if($value->get_rpd_5()>100){$rpd5=100;}elseif(is_null($value->get_rpd_5())){$rpd5 = '-';}else{$rpd5=$value->get_rpd_5();}
                        if($value->get_rpd_6()>100){$rpd6=100;}elseif(is_null($value->get_rpd_6())){$rpd6 = '-';}else{$rpd6=$value->get_rpd_6();}
                        if($value->get_rpd_7()>100){$rpd7=100;}elseif(is_null($value->get_rpd_7())){$rpd7 = '-';}else{$rpd7=$value->get_rpd_7();}
                        if($value->get_rpd_8()>100){$rpd8=100;}elseif(is_null($value->get_rpd_8())){$rpd8 = '-';}else{$rpd8=$value->get_rpd_8();}
                        if($value->get_rpd_9()>100){$rpd9=100;}elseif(is_null($value->get_rpd_9())){$rpd9 = '-';}else{$rpd9=$value->get_rpd_9();}
                        if($value->get_rpd_10()>100){$rpd10=100;}elseif(is_null($value->get_rpd_10())){$rpd10 = '-';}else{$rpd10=$value->get_rpd_10();}
                        if($value->get_rpd_11()>100){$rpd11=100;}elseif(is_null($value->get_rpd_11())){$rpd11 = '-';}else{$rpd11=$value->get_rpd_11();}
                        if($value->get_rpd_12()>100){$rpd12=100;}elseif(is_null($value->get_rpd_12())){$rpd12 = '-';}else{$rpd12=$value->get_rpd_12();}
                        if($value->get_rpd_13()>100){$rpd13=100;}elseif(is_null($value->get_rpd_13())){$rpd13 = '-';}else{$rpd14=$value->get_rpd_13();}
                        if($value->get_rpd_14()>100){$rpd14=100;}elseif(is_null($value->get_rpd_14())){$rpd14 = '-';}else{$rpd14=$value->get_rpd_14();}
                        if($value->get_rpd_15()>100){$rpd15=100;}elseif(is_null($value->get_rpd_15())){$rpd15 = '-';}else{$rpd15=$value->get_rpd_15();}
                        if($value->get_rpd_16()>100){$rpd16=100;}elseif(is_null($value->get_rpd_16())){$rpd16 = '-';}else{$rpd16=$value->get_rpd_16();}
                        if($value->get_rpd_17()>100){$rpd17=100;}elseif(is_null($value->get_rpd_17())){$rpd17 = '-';}else{$rpd17=$value->get_rpd_17();}
                        if($value->get_rpd_18()>100){$rpd18=100;}elseif(is_null($value->get_rpd_18())){$rpd18 = '-';}else{$rpd18=$value->get_rpd_18();}
                        if($value->get_rpd_19()>100){$rpd19=100;}elseif(is_null($value->get_rpd_19())){$rpd19 = '-';}else{$rpd19=$value->get_rpd_19();}
                        if($value->get_rpd_20()>100){$rpd20=100;}elseif(is_null($value->get_rpd_20())){$rpd20 = '-';}else{$rpd20=$value->get_rpd_20();}
                        if($value->get_rpd_21()>100){$rpd21=100;}elseif(is_null($value->get_rpd_21())){$rpd21 = '-';}else{$rpd21=$value->get_rpd_21();}
                        if($value->get_rpd_22()>100){$rpd22=100;}elseif(is_null($value->get_rpd_22())){$rpd22 = '-';}else{$rpd22=$value->get_rpd_22();}
                        if($value->get_rpd_23()>100){$rpd23=100;}elseif(is_null($value->get_rpd_23())){$rpd23 = '-';}else{$rpd23=$value->get_rpd_23();}
                        if($value->get_rpd_24()>100){$rpd24=100;}elseif(is_null($value->get_rpd_24())){$rpd24 = '-';}else{$rpd24=$value->get_rpd_24();}
                        if($value->get_rpd_25()>100){$rpd25=100;}elseif(is_null($value->get_rpd_25())){$rpd25 = '-';}else{$rpd25=$value->get_rpd_25();}
                        if($value->get_rpd_26()>100){$rpd26=100;}elseif(is_null($value->get_rpd_26())){$rpd26 = '-';}else{$rpd26=$value->get_rpd_26();}
                        if($value->get_rpd_27()>100){$rpd27=100;}elseif(is_null($value->get_rpd_27())){$rpd27 = '-';}else{$rpd27=$value->get_rpd_27();}
                        if($value->get_rpd_28()>100){$rpd28=100;}elseif(is_null($value->get_rpd_28())){$rpd28 = '-';}else{$rpd28=$value->get_rpd_28();}
                        if($value->get_rpd_29()>100){$rpd29=100;}elseif(is_null($value->get_rpd_29())){$rpd29 = '-';}else{$rpd29=$value->get_rpd_29();}
                        if($value->get_rpd_30()>100){$rpd30=100;}elseif(is_null($value->get_rpd_30())){$rpd30 = '-';}else{$rpd30=$value->get_rpd_30();}
                        if($value->get_rpd_31()>100){$rpd31=100;}elseif(is_null($value->get_rpd_31())){$rpd31 = '-';}else{$rpd31=$value->get_rpd_31();}
                        echo "<tr>	";
                        echo "<td class='align-center'>" . $no++ . "</td>";
                        echo "<td class='align-center'>" . $value->get_kdsatker() . "</td>";
                        echo "<td class='align-left'>" . $value->get_nmsatker() . "</td>";
                        if($rpd1=='-'){echo "<td>-</td>";}else{echo "<td>".number_format($rpd1,2,",",".")."</td>";}
                        if($rpd2=='-'){echo "<td>-</td>";}else{echo "<td>".number_format($rpd2,2,",",".")."</td>";}
                        if($rpd3=='-'){echo "<td>-</td>";}else{echo "<td>".number_format($rpd3,2,",",".")."</td>";}
                        if($rpd4=='-'){echo "<td>-</td>";}else{echo "<td>".number_format($rpd4,2,",",".")."</td>";}
                        if($rpd5=='-'){echo "<td>-</td>";}else{echo "<td>".number_format($rpd5,2,",",".")."</td>";}
                        if($rpd6=='-'){echo "<td>-</td>";}else{echo "<td>".number_format($rpd6,2,",",".")."</td>";}
                        if($rpd7=='-'){echo "<td>-</td>";}else{echo "<td>".number_format($rpd7,2,",",".")."</td>";}
                        if($rpd8=='-'){echo "<td>-</td>";}else{echo "<td>".number_format($rpd8,2,",",".")."</td>";}
                        if($rpd9=='-'){echo "<td>-</td>";}else{echo "<td>".number_format($rpd9,2,",",".")."</td>";}
                        if($rpd10=='-'){echo "<td>-</td>";}else{echo "<td>".number_format($rpd10,2,",",".")."</td>";}
                        if($rpd11=='-'){echo "<td>-</td>";}else{echo "<td>".number_format($rpd11,2,",",".")."</td>";}
                        if($rpd12=='-'){echo "<td>-</td>";}else{echo "<td>".number_format($rpd12,2,",",".")."</td>";}
                        if($rpd13=='-'){echo "<td>-</td>";}else{echo "<td>".number_format($rpd13,2,",",".")."</td>";}
                        if($rpd14=='-'){echo "<td>-</td>";}else{echo "<td>".number_format($rpd14,2,",",".")."</td>";}
                        if($rpd15=='-'){echo "<td>-</td>";}else{echo "<td>".number_format($rpd15,2,",",".")."</td>";}
                        if($rpd16=='-'){echo "<td>-</td>";}else{echo "<td>".number_format($rpd16,2,",",".")."</td>";}
                        if($rpd17=='-'){echo "<td>-</td>";}else{echo "<td>".number_format($rpd17,2,",",".")."</td>";}
                        if($rpd18=='-'){echo "<td>-</td>";}else{echo "<td>".number_format($rpd18,2,",",".")."</td>";}
                        if($rpd19=='-'){echo "<td>-</td>";}else{echo "<td>".number_format($rpd19,2,",",".")."</td>";}
                        if($rpd20=='-'){echo "<td>-</td>";}else{echo "<td>".number_format($rpd20,2,",",".")."</td>";}
                        if($rpd21=='-'){echo "<td>-</td>";}else{echo "<td>".number_format($rpd21,2,",",".")."</td>";}
                        if($rpd22=='-'){echo "<td>-</td>";}else{echo "<td>".number_format($rpd22,2,",",".")."</td>";}
                        if($rpd23=='-'){echo "<td>-</td>";}else{echo "<td>".number_format($rpd23,2,",",".")."</td>";}
                        if($rpd24=='-'){echo "<td>-</td>";}else{echo "<td>".number_format($rpd24,2,",",".")."</td>";}
                        if($rpd25=='-'){echo "<td>-</td>";}else{echo "<td>".number_format($rpd25,2,",",".")."</td>";}
                        if($rpd26=='-'){echo "<td>-</td>";}else{echo "<td>".number_format($rpd26,2,",",".")."</td>";}
                        if($rpd27=='-'){echo "<td>-</td>";}else{echo "<td>".number_format($rpd27,2,",",".")."</td>";}
                        if($rpd28=='-'){echo "<td>-</td>";}else{echo "<td>".number_format($rpd28,2,",",".")."</td>";}
                        if($rpd29=='-'){echo "<td>-</td>";}else{echo "<td>".number_format($rpd29,2,",",".")."</td>";}
                        if($rpd30=='-'){echo "<td>-</td>";}else{echo "<td>".number_format($rpd30,2,",",".")."</td>";}
                        if($rpd31=='-'){echo "<td>-</td>";}else{echo "<td>".number_format($rpd31,2,",",".")."</td>";}
                        echo "</tr>	";  
                        $total_rpd1 += $rpd1;
                        $total_rpd2 += $rpd2;
                        $total_rpd3 += $rpd3;
                        $total_rpd4 += $rpd4;
                        $total_rpd5 += $rpd5;
                        $total_rpd6 += $rpd6;
                        $total_rpd7 += $rpd7;
                        $total_rpd8 += $rpd8;
                        $total_rpd9 += $rpd9;
                        $total_rpd10 += $rpd10;
                        $total_rpd11 += $rpd11;
                        $total_rpd12 += $rpd12;
                        $total_rpd13 += $rpd13;
                        $total_rpd14 += $rpd14;
                        $total_rpd15 += $rpd15;
                        $total_rpd16 += $rpd16;
                        $total_rpd17 += $rpd17;
                        $total_rpd18 += $rpd18;
                        $total_rpd19 += $rpd19;
                        $total_rpd20 += $rpd20;
                        $total_rpd21 += $rpd21;
                        $total_rpd22 += $rpd22;
                        $total_rpd23 += $rpd23;
                        $total_rpd24 += $rpd24;
                        $total_rpd25 += $rpd25;
                        $total_rpd26 += $rpd26;
                        $total_rpd27 += $rpd27;
                        $total_rpd28 += $rpd28;
                        $total_rpd29 += $rpd29;
                        $total_rpd30 += $rpd30;
                        $total_rpd31 += $rpd31;
                    }
                }
            } else {
                echo '<td colspan=12 align="center" id="filter-first">Silahkan masukkan filter terlebih dahulu.</td>';
            }
            ?>
        </tbody>
        <?php if (isset($this->data)) {
                if (!empty($this->data)) { ?>
        <tfoot>
            <tr>
                <td colspan="3">Deviasi Rata-Rata</td>
                <td>
                    <?php 
                        $total_rpd1=$total_rpd1/($no-1); 
                        if ($total_rpd1>100) {$total_rpd1=100;}
                        echo number_format($total_rpd1,2,",",".")
                    ?>
                </td>
                <td>
                    <?php 
                        $total_rpd2=$total_rpd2/($no-1); 
                        if ($total_rpd2>100) {$total_rpd2=100;}
                        echo number_format($total_rpd2,2,",",".")
                    ?>
                </td>
                <td>
                    <?php 
                        $total_rpd3=$total_rpd3/($no-1); 
                        if ($total_rpd3>100) {$total_rpd3=100;}
                        echo number_format($total_rpd3,2,",",".")
                    ?>
                </td>
                <td>
                    <?php 
                        $total_rpd4=$total_rpd4/($no-1); 
                        if ($total_rpd4>100) {$total_rpd4=100;}
                        echo number_format($total_rpd4,2,",",".")
                    ?>
                </td>
                <td>
                    <?php 
                        $total_rpd5=$total_rpd5/($no-1); 
                        if ($total_rpd5>100) {$total_rpd5=100;}
                        echo number_format($total_rpd5,2,",",".")
                    ?>
                </td>
                <td>
                    <?php 
                        $total_rpd6=$total_rpd6/($no-1); 
                        if ($total_rpd6>100) {$total_rpd6=100;}
                        echo number_format($total_rpd6,2,",",".")
                    ?>
                </td>
                <td>
                    <?php 
                        $total_rpd7=$total_rpd7/($no-1); 
                        if ($total_rpd7>100) {$total_rpd7=100;}
                        echo number_format($total_rpd7,2,",",".")
                    ?>
                </td>
                <td>
                    <?php 
                        $total_rpd8=$total_rpd8/($no-1); 
                        if ($total_rpd8>100) {$total_rpd8=100;}
                        echo number_format($total_rpd8,2,",",".")
                    ?>
                </td>
                <td>
                    <?php 
                        $total_rpd9=$total_rpd9/($no-1); 
                        if ($total_rpd9>100) {$total_rpd9=100;}
                        echo number_format($total_rpd9,2,",",".")
                    ?>
                </td>
                <td>
                    <?php 
                        $total_rpd10=$total_rpd10/($no-1); 
                        if ($total_rpd10>100) {$total_rpd10=100;}
                        echo number_format($total_rpd10,2,",",".")
                    ?>
                </td>
                <td>
                    <?php 
                        $total_rpd11=$total_rpd11/($no-1); 
                        if ($total_rpd11>100) {$total_rpd11=100;}
                        echo number_format($total_rpd11,2,",",".")
                    ?>
                </td>
                <td>
                    <?php 
                        $total_rpd12=$total_rpd12/($no-1); 
                        if ($total_rpd12>100) {$total_rpd12=100;}
                        echo number_format($total_rpd12,2,",",".")
                    ?>
                </td>
                <td>
                    <?php 
                        $total_rpd13=$total_rpd13/($no-1); 
                        if ($total_rpd13>100) {$total_rpd13=100;}
                        echo number_format($total_rpd13,2,",",".")
                    ?>
                </td>
                
                <td>
                    <?php 
                        $total_rpd14=$total_rpd14/($no-1); 
                        if ($total_rpd14>100) {$total_rpd14=100;}
                        echo number_format($total_rpd14,2,",",".")
                    ?>
                </td>
                <td>
                    <?php 
                        $total_rpd15=$total_rpd15/($no-1); 
                        if ($total_rpd15>100) {$total_rpd15=100;}
                        echo number_format($total_rpd15,2,",",".")
                    ?>
                </td>
                <td>
                    <?php 
                        $total_rpd16=$total_rpd16/($no-1); 
                        if ($total_rpd16>100) {$total_rpd16=100;}
                        echo number_format($total_rpd16,2,",",".")
                    ?>
                </td>
                <td>
                    <?php 
                        $total_rpd17=$total_rpd17/($no-1); 
                        if ($total_rpd17>100) {$total_rpd17=100;}
                        echo number_format($total_rpd17,2,",",".")
                    ?>
                </td>
                <td>
                    <?php 
                        $total_rpd18=$total_rpd18/($no-1); 
                        if ($total_rpd18>100) {$total_rpd18=100;}
                        echo number_format($total_rpd18,2,",",".")
                    ?>
                </td>
                <td>
                    <?php 
                        $total_rpd19=$total_rpd19/($no-1); 
                        if ($total_rpd19>100) {$total_rpd19=100;}
                        echo number_format($total_rpd19,2,",",".")
                    ?>
                </td>
                <td>
                    <?php 
                        $total_rpd20=$total_rpd20/($no-1); 
                        if ($total_rpd20>100) {$total_rpd20=100;}
                        echo number_format($total_rpd20,2,",",".")
                    ?>
                </td>
                <td>
                    <?php 
                        $total_rpd21=$total_rpd21/($no-1); 
                        if ($total_rpd21>100) {$total_rpd21=100;}
                        echo number_format($total_rpd21,2,",",".")
                    ?>
                </td>
                <td>
                    <?php 
                        $total_rpd22=$total_rpd22/($no-1); 
                        if ($total_rpd22>100) {$total_rpd22=100;}
                        echo number_format($total_rpd22,2,",",".")
                    ?>
                </td>
                <td>
                    <?php 
                        $total_rpd23=$total_rpd23/($no-1); 
                        if ($total_rpd23>100) {$total_rpd23=100;}
                        echo number_format($total_rpd23,2,",",".")
                    ?>
                </td>
                <td>
                    <?php 
                        $total_rpd24=$total_rpd24/($no-1); 
                        if ($total_rpd24>100) {$total_rpd24=100;}
                        echo number_format($total_rpd24,2,",",".")
                    ?>
                </td>
                <td>
                    <?php 
                        $total_rpd25=$total_rpd25/($no-1); 
                        if ($total_rpd25>100) {$total_rpd25=100;}
                        echo number_format($total_rpd25,2,",",".")
                    ?>
                </td>
                <td>
                    <?php 
                        $total_rpd26=$total_rpd26/($no-1); 
                        if ($total_rpd26>100) {$total_rpd26=100;}
                        echo number_format($total_rpd26,2,",",".")
                    ?>
                </td>
                <td>
                    <?php 
                        $total_rpd27=$total_rpd27/($no-1); 
                        if ($total_rpd27>100) {$total_rpd27=100;}
                        echo number_format($total_rpd27,2,",",".")
                    ?>
                </td>
                <td>
                    <?php 
                        $total_rpd28=$total_rpd28/($no-1); 
                        if ($total_rpd28>100) {$total_rpd28=100;}
                        echo number_format($total_rpd28,2,",",".")
                    ?>
                </td>
                <td>
                    <?php 
                        $total_rpd29=$total_rpd29/($no-1); 
                        if ($total_rpd29>100) {$total_rpd29=100;}
                        echo number_format($total_rpd29,2,",",".")
                    ?>
                </td>
                <td>
                    <?php 
                        $total_rpd30=$total_rpd30/($no-1); 
                        if ($total_rpd30>100) {$total_rpd30=100;}
                        echo number_format($total_rpd30,2,",",".")
                    ?>
                </td>
                <td>
                    <?php 
                        $total_rpd31=$total_rpd31/($no-1); 
                        if ($total_rpd31>100) {$total_rpd31=100;}
                        echo number_format($total_rpd31,2,",",".")
                    ?>
                </td>
            </tr>
        </tfoot>
        <?php } 
            }?>
    </table>
</div>

<!-- Filter -->
<div class="modal fade" id="modal-app-filter" tabindex="-1" role="dialog" aria-labelledby="app-filter-label" aria-hidden="true">

    <div class="modal-dialog">

        <div class="modal-content">

            <div class="modal-header">

                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Tutup</span></button>
                <h4 class="modal-title" id="app-filter-label"><span class="glyphicon glyphicon-filter"></span> Filter Data</h4>

            </div>

            <form id="filter-form" method="POST" action=<?php echo URL."dataRPD/rekapRPDSatker" ?> enctype="multipart/form-data">

                <div class="modal-body">

                    <!-- Paste Isi Fom mulai nangkene -->
                    <div>
                        <div>
                        <div id="wbulan" class='alert alert-danger' style='display:none;'></div>
                        <label class="isian">Bulan: </label>
                        <select class="form-control" type="text" name="bulan" id="bulan">
                        <option value='01' <?php if ($this->d_bulan == '01') {
    echo "selected";
} ?> >Januari</option>
                        <option value='02' <?php if ($this->d_bulan == '02') {
    echo "selected";
} ?> >Februari</option>
                        <option value='03' <?php if ($this->d_bulan == '03') {
    echo "selected";
} ?> >Maret</option>
                        <option value='04' <?php if ($this->d_bulan == '04') {
    echo "selected";
} ?> >April</option>
                        <option value='05' <?php if ($this->d_bulan == '05') {
    echo "selected";
} ?> >Mei</option>
                        <option value='06' <?php if ($this->d_bulan == '06') {
    echo "selected";
} ?> >Juni</option>
                        <option value='07' <?php if ($this->d_bulan == '07') {
    echo "selected";
} ?> >Juli</option>
                        <option value='08' <?php if ($this->d_bulan == '08') {
    echo "selected";
} ?> >Agustus</option>
                        <option value='09' <?php if ($this->d_bulan == '09') {
    echo "selected";
} ?> >September</option>
                        <option value='10' <?php if ($this->d_bulan == '10') {
    echo "selected";
} ?> >Oktober</option>
                        <option value='11' <?php if ($this->d_bulan == '11') {
    echo "selected";
} ?> >November</option>
                        <option value='12' <?php if ($this->d_bulan == '12') {
    echo "selected";
} ?> >Desember</option>
                    </select>
                </div>
                    <?php if (isset($this->kppn_list)) { ?>
                        <br/>
                        <div id="wkdkppn" class='alert alert-danger' style='display:none;'></div>
                        <label class="isian">Kode KPPN: </label>
                        <select class="form-control" type="text" name="kdkppn" id="kdkppn">
                            <?php
                            foreach ($this->kppn_list as $value1) {
                                if ($kode_kppn == $value1->get_kd_d_kppn()) {
                                    echo "<option value='" . $value1->get_kd_d_kppn() . "' selected>" . $value1->get_kd_d_kppn() . " | " . $value1->get_nama_user() . "</option>";
                                } else {
                                    echo "<option value='" . $value1->get_kd_d_kppn() . "'>" . $value1->get_kd_d_kppn() . " | " . $value1->get_nama_user() . "</option>";
                                }
                            }
                            ?>
                        </select>
                    <?php } ?>
                    <?php
                    if (Session::get('role') != SATKER) {
                        echo "<br/>";
                        echo "<div id='wsatker' class='alert alert-danger' style='display:none;'></div>";
                        echo "<label class='isian'>Kode Satker: </label>";
                    }
                    ?>

                    <input class="form-control" type="<?php
                           if (Session::get('role') == SATKER) {
                               echo "hidden";
                           } else {
                               echo "number";
                           }
                           ?>" name="kdsatker" id="kdsatker" size="6" value="<?php
                           if (isset($this->d_kdsatker)) {
                               echo $this->d_kdsatker;
                           }
                           ?>">
                    <br/>
                </div>
                </div>
                <div class="modal-footer">
                    <button type="submit" name="submit_file" class="btn btn-primary" style="width: 100%" onClick="return cek_upload()">Kirim</button>
                </div>

            </form>

        </div>

    </div>

</div>



<!-- Skrip -->
<script type="text/javascript" charset="utf-8">
    $(function() {
        hideErrorId();
        hideWarning();
    });



    function hideErrorId() {
        $('.error').fadeOut(0);
    }

    function hideWarning() {

        $('#nosp2d').keyup(function() {
            if (document.getElementById('nosp2d').value != '') {
                $('#wsp2d').fadeOut(200);
            }
        });

        $('#barsp2d').keyup(function() {
            if (document.getElementById('barsp2d').value != '') {
                $('#wbarsp2d').fadeOut(200);
            }
        });

        $('#kdsatker').keyup(function() {
            if (document.getElementById('kdsatker').value != '') {
                $('#wsatker').fadeOut(200);
            }
        });

        $('#invoice').keyup(function() {
            if (document.getElementById('invoice').value != '') {
                $('#winvoice').fadeOut(200);
            }
        });

        $('#vendor_name').keyup(function() {
            if (document.getElementById('vendor_name').value != '') {
                $('#wvendor_name').fadeOut(200);
            }
        });

        $('#bank').change(function() {
            if (document.getElementById('bank').value != '') {
                $('#wbank').fadeOut(200);
            }
        });

        $('#status').change(function() {
            if (document.getElementById('status').value != '') {
                $('#wstatus').fadeOut(200);
            }
        });

        $('#bayar').change(function() {
            if (document.getElementById('bayar').value != '') {
                $('#wbayar').fadeOut(200);
            }
        });

        $('#tgl_awal').change(function() {
            if (document.getElementById('tgl_awal').value != '' && document.getElementById('tgl_akhir').value != '') {
                $('#wtgl').fadeOut(200);
            }
        });

        $('#tgl_akhir').change(function() {
            if (document.getElementById('tgl_awal').value != '' && document.getElementById('tgl_akhir').value != '') {
                $('#wtgl').fadeOut(200);
            }
        });

    }

    function cek_upload() {

        document.getElementById('invoice').value = document.getElementById('invoice').value.replace(/</g, '').replace(/>/g, '');

        var pattern = '^[0-9]+$';
        var v_nosp2d = document.getElementById('nosp2d').value;
        var v_barsp2d = document.getElementById('barsp2d').value;
        var v_kdsatker = document.getElementById('kdsatker').value;
        var v_invoice = document.getElementById('invoice').value;
        var v_vendor_name = document.getElementById('vendor_name').value;
        var v_bank = document.getElementById('bank').value;
        var v_status = document.getElementById('status').value;
        var v_bayar = document.getElementById('bayar').value;
        var v_tglawal = document.getElementById('tgl_awal').value;
        var v_tglakhir = document.getElementById('tgl_akhir').value;

        var jml = 0;
        if (v_nosp2d == '' && v_barsp2d == '' && v_kdsatker == '' && v_invoice == '' && v_vendor_name == '' && v_bank == '' && v_status == '' && v_bayar == '' && (v_tglawal == '' || v_tglakhir == '')) {
            $('#wsp2d').html('Harap isi salah satu parameter');
            $('#wsp2d').fadeIn();
            jml++;
        }

        if (v_tglawal == '' || v_tglakhir == '') {
            if (v_nosp2d == '' && v_barsp2d == '' && v_invoice == '' && v_vendor_name == '') {
                $('#wsp2d').html('Harap isi salah satu parameter');
                $('#wsp2d').fadeIn();
                $('#wbarsp2d').html('Harap isi salah satu parameter');
                $('#wbarsp2d').fadeIn();
                $('#winvoice').html('Harap isi salah satu parameter');
                $('#winvoice').fadeIn();
                $('#wvendor_name').html('Harap isi salah satu parameter');
                $('#wvendor_name').fadeIn();
                jml++;
            }
        }

        if (v_nosp2d != '' && v_nosp2d.length != 15) {
            $('#wsp2d').html('No. SP2D harus 15 digit');
            $('#wsp2d').fadeIn(200);
            jml++;
        }

        if (v_nosp2d != '' && !v_nosp2d.match(pattern)) {
            var wsp2d = 'No SP2D harus dalam bentuk angka!';
            $('#wsp2d').html(wsp2d);
            $('#wsp2d').fadeIn(200);
            jml++;
        }

        if (v_barsp2d != '' && v_barsp2d.length != 21) {
            $('#wbarsp2d').html('No. Transaksi harus 21 digit');
            $('#wbarsp2d').fadeIn(200);
            jml++;
        }

        if (v_barsp2d != '' && !v_barsp2d.match(pattern)) {
            var wbarsp2d = 'No Transaksi harus dalam bentuk angka!';
            $('#wbarsp2d').html(wbarsp2d);
            $('#wbarsp2d').fadeIn(200);
            jml++;
        }

        if (v_kdsatker != '' && v_kdsatker.length != 6) {
            $('#wsatker').html('Kode Satker harus 6 digit');
            $('#wsatker').fadeIn(200);
            jml++;
        }

        if (v_kdsatker != '' && !v_kdsatker.match(pattern)) {
            var wsatker = 'Kode Satker harus dalam bentuk angka!';
            $('#wsatker').html(wsatker);
            $('#wsatker').fadeIn(200);
            jml++;
        }

        if (v_invoice != '' && v_invoice.length != 18) {
            $('#winvoice').html('No. invoice harus 18 digit');
            $('#winvoice').fadeIn(200);
            jml++;
        }


        if (jml > 0) {
            return false;
        }
    }

</script>
<div class="main-window-segment vertical-padded">
    <div class="container-fluid">
        <div class="row">
            <div class="col-md-12">
                Pertanyaan menu RPD harap menghubungi PIC Direktorat PKN :</br>
                1. Zakaria, HP : 085226950999, email : zacky.469@gmail.com<br>
                2. Tri Angga Sigit, HP : 081410109462, Email : hanif643@gmail.com
            </div>

        </div>
    </div>
</div>